package com.njupt.yanglonglong.report.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.njupt.yanglonglong.report.demo.utils.TimeUtil;
import lombok.Data;
import org.apache.http.client.utils.DateUtils;

/**
 * @TableName device_applied
 */
@TableName(value = "device_applied")
@Data
public class DeviceApplied implements Serializable {
    /**
     * 设备id
     */
    @TableId(value = "device_id", type = IdType.ASSIGN_UUID)
    private String deviceId;

    /**
     * 设备类型
     */
    @TableField(value = "device_type")
    private String deviceType;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private String userId;

    /**
     * 实验id
     */
    @TableField(value = "exper_id")
    private String experId;

    /**
     * 设备申请时间
     */
    @TableField(value = "modified_time")
    private String modified_time;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public DeviceApplied(String deviceId, String deviceType) {
        this.deviceId = deviceId;
        this.deviceType = deviceType;
        this.modified_time = TimeUtil.format(new Date());
    }
}
